﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>PingPort（检测与服务器指定端口的连通延迟）</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<P>函数原型：<br>Function PingPort(IP As WString Ptr, Port As Integer) As Integer<br>int PingPort(wchar* IP, int Port);</P>
<P>VB、VBS、按键精灵声明：<br>Declare Function Lib "xTask.dll" PingPort(ByVal IP As String, ByVal Port As Long) As Long</P>
<P>参数：<br>IP：IP地址，字符串，可以是域名<br>Port：尝试连接的端口</P>
<P>成功返回连通到服务器需要的时间（毫秒），失败返回-1</P>
<P>说明：<br>本质上就是尝试与指定端口握手，返回握手需要的时间，可以测试大多数服务器的延迟。</P>
</body>
</html>